<?php

/* ========= EXTRA SEARCH VALUES ============= */

$type 		= get_post_meta($post->ID, "type", true);
$item_qty 	= get_post_meta($post->ID, "qty", true);

/* ========= CHECK FOR MEMBER PRICING DISPLAY ============= */

if($GLOBALS['shopperpress']['price_tag'] =="member" && $current_user->ID == 0){ 
	$ItemPrice =0; 
}else{
	$ItemPrice = ShopperPressMoneyFormat(GetPrice(get_post_meta($post->ID, "price", true)));
}

/* ========= DISPLAY THE ITEM  ============= */
 
if($type !="article" && $post->post_type != "page"){ 
?>
<!--Start of list item-->
<li>

<div class="ProductImage<?php echo $GLOBALS['SP_LAY_CONTENT_LIST'] ?>">

	<div style="height:140px; overflow:hidden;"><center>
        <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" <?php if($GLOBALS['shopperpress']['analytics_tracking'] =="yes"){ ?>onclick="pageTracker._trackEvent('PRODUCTS', 'Gallery View Items', '<?php the_title(); ?>');"<?php } ?>>
            <img src="<?php if(strlen($DisplaayImage) <5 ){ echo bloginfo('template_url')."/images/noimg.gif";  }else{ echo SPImage($DisplaayImage,"m"); } ?>" alt="<?php the_title(); ?>" class="main_big_img" />
         </a>
    </center></div>     

 
<div class="ProductName">
	<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" <?php if($GLOBALS['shopperpress']['analytics_tracking'] =="yes"){ ?>onclick="pageTracker._trackEvent('PRODUCTS', 'Gallery View Items', '<?php the_title(); ?>');"<?php } ?>>
		<?php echo substr(strip_tags($post->post_title), 0, 45)."...";?>
    </a>
</div>

<div class="ProductPrice">
<br />
	<?php if($GLOBALS['shopperpress']['price_tag'] !="no"){ ?>

	<?php if(strlen($oldPrice) > 1 && $ItemPrice > 0){ ?>
    	<strike style="font-size:11px;"><?php echo $_SESSION['currency_symbol']; ?> <?php echo ShopperPressMoneyFormat(get_post_meta($post->ID, "old_price", true)); ?></strike>
	<?php } ?>
	<?php if($ItemPrice > 0){ ?>
	<?php echo $_SESSION['currency_symbol']; ?> <?php echo $ItemPrice; ?>
	<?php } ?>
	<?php } ?>
 </div>

<?php if($GLOBALS['shopperpress']['display_cart'] =="yes" && $GLOBALS['shopperpress']['system'] == "cart" && get_post_meta($post->ID, "amazon_link", true) =="" && get_post_meta($post->ID, "affiliate_productID", true) =="" && strlen($FoundShipping ) < 5 && strlen($oldPrice) < 1){ ?>
<div class="ProductAdd">
<br />
<?php if($item_qty > 0){ ?>
    <a href="#" onclick="<?php echo getBuyLink($post); ?> <?php if($GLOBALS['shopperpress']['analytics_tracking'] =="yes"){ ?>pageTracker._trackEvent('HOME PAGE', 'Add Cart', '<?php the_title(); ?>');<?php } ?>" title="<?php the_title(); ?>" title="<?php echo SPEC($GLOBALS['_LANG']['_addtocart']) ?>">
    <?php echo SPEC($GLOBALS['_LANG']['_add']) ?>
    </a>
<?php } ?>    
</div>
<?php } ?>
 </div>
</li>	
<!-- End of list item-->
<?php } ?>